Admin Functions
This section details the administrative functions available in the contract, including staker management and role transfers.
Presale Staker Management
addPresaleStaker
Function Type: external
Function Signature: addPresaleStaker(address)
Function Selector: 0x6c58f77b
Allows the admin to add a single new presale staker to the contract. Limited to a maximum of 800 total presale stakers.
Parameters
Parameter | Type | Description |
---|---|---|
_staker | address | Address of the new presale staker |
Workflow
- Admin Verification: Verifies the caller has admin privileges using
onlyOwner
modifier - Limit Check: Checks that adding this staker won't exceed the 800 staker limit (
LIMIT_PRESALE_STAKER
) - Add Staker: Sets
userPresaleStaker[_staker].isAllow = true
to enable presale staking for the address - Increment Counter: Increases
presaleStakerCount
to track total presale stakers
addPresaleStakers
Function Type: external
Function Signature: addPresaleStakers(address[])
Function Selector: 0xbe100345
Allows the admin to add multiple presale stakers in a single transaction. Limited to a maximum of 800 total presale stakers.
Parameters
Parameter | Type | Description |
---|---|---|
_stakers | address[] | Array of addresses of new presale stakers |
Workflow
- Admin Verification: Verifies the caller has admin privileges using
onlyOwner
modifier - Batch Processing: Iterates through the array of staker addresses
- Limit Check: For each address, checks that adding this staker won't exceed the 800 staker limit (
LIMIT_PRESALE_STAKER
) - Add Staker: Sets
userPresaleStaker[_stakers[i]].isAllow = true
for each address - Increment Counter: Increases
presaleStakerCount
for each successfully added staker
Role Transfer Processes
Admin Change Process
The admin role transfer follows a secure two-step process with a mandatory waiting period.
proposeAdmin
Function Type: external
Function Signature: proposeAdmin(address)
Function Selector: 0x147bf6c4
Initiates the admin change process by proposing a new admin address.
Parameters
Parameter | Type | Description |
---|---|---|
_newAdmin | address | Address of the proposed new admin |
rejectProposalAdmin
Function Type: external
Function Signature: rejectProposalAdmin()
Function Selector: 0xb38c950a
Allows the current admin to cancel a pending admin change proposal.
acceptNewAdmin
Function Type: external
Function Signature: acceptNewAdmin()
Function Selector: 0xcd6b5460
Allows the proposed admin to accept the role after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The current admin calls
proposeAdmin
with the new admin address - Sets
admin.proposal = _newAdmin
andadmin.timeToAccept = block.timestamp + 1 days
- The current admin calls
-
Proposal Cancellation (Optional):
- The current admin can call
rejectProposalAdmin
to cancel the proposal at any time - Resets
admin.proposal = address(0)
andadmin.timeToAccept = 0
- The current admin can call
-
Role Acceptance:
- The proposed admin must wait 24 hours (1 day) after the proposal timestamp
- The proposed admin calls
acceptNewAdmin
to complete the transfer - Function verifies
msg.sender == admin.proposal
andadmin.timeToAccept <= block.timestamp
- Updates
admin.actual = admin.proposal
and resets proposal fields
Golden Fisher Role Transfer
The golden fisher role transfer follows a similar secure two-step process with a mandatory waiting period.
proposeGoldenFisher
Function Type: external
Function Signature: proposeGoldenFisher(address)
Function Selector: 0x489c5ad4
Initiates the golden fisher change process by proposing a new golden fisher address.
Parameters
Parameter | Type | Description |
---|---|---|
_goldenFisher | address | Address of the proposed new golden fisher |
rejectProposalGoldenFisher
Function Type: external
Function Signature: rejectProposalGoldenFisher()
Function Selector: 0xa84e9f23
Allows the current golden fisher to cancel a pending golden fisher change proposal.
acceptNewGoldenFisher
Function Type: external
Function Signature: acceptNewGoldenFisher()
Function Selector: 0x34dd90d6
Allows the admin to confirm the new golden fisher role assignment after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The admin calls
proposeGoldenFisher
with the new golden fisher address - Sets
goldenFisher.proposal = _goldenFisher
andgoldenFisher.timeToAccept = block.timestamp + 1 days
- The admin calls
-
Proposal Cancellation (Optional):
- The admin can call
rejectProposalGoldenFisher
to cancel the proposal at any time - Resets
goldenFisher.proposal = address(0)
andgoldenFisher.timeToAccept = 0
- The admin can call
-
Role Confirmation:
- The admin must wait 24 hours (1 day) after the proposal timestamp
- The admin calls
acceptNewGoldenFisher
to complete the transfer - Function verifies
goldenFisher.timeToAccept <= block.timestamp
- Updates
goldenFisher.actual = goldenFisher.proposal
and resets proposal fields
Staking Unlock Period Modification
The staking unlock period modification follows a secure two-step process with a mandatory waiting period.
proposeSetSecondsToUnlockStaking
Function Type: external
Function Signature: proposeSetSecondsToUnlockStaking(uint256)
Function Selector: 0x6b2933a2
Initiates the process to change the staking unlock period.
Parameters
Parameter | Type | Description |
---|---|---|
_secondsToUnlockStaking | uint256 | New staking unlock period in seconds |
rejectProposalSetSecondsToUnlockStaking
Function Type: external
Function Signature: rejectProposalSetSecondsToUnlockStaking()
Function Selector: 0x7c25faef
Allows the current admin to cancel a pending staking unlock period change proposal.
acceptSetSecondsToUnlockStaking
Function Type: external
Function Signature: acceptSetSecondsToUnlockStaking()
Function Selector: 0x610a0476
Allows the admin to confirm the new staking unlock period after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The admin calls
proposeSetSecondsToUnlockStaking
with the new unlock period value - Sets
secondsToUnlockStaking.proposal = _secondsToUnlockStaking
andsecondsToUnlockStaking.timeToAccept = block.timestamp + 1 days
- The admin calls
-
Proposal Cancellation (Optional):
- The admin can call
rejectProposalSetSecondsToUnlockStaking
to cancel the proposal at any time - Resets
secondsToUnlockStaking.proposal = 0
andsecondsToUnlockStaking.timeToAccept = 0
- The admin can call
-
Change Confirmation:
- The admin must wait 24 hours (1 day) after the proposal timestamp
- The admin calls
acceptSetSecondsToUnlockStaking
to implement the change - Function verifies
secondsToUnlockStaking.timeToAccept <= block.timestamp
- Updates
secondsToUnlockStaking.actual = secondsToUnlockStaking.proposal
and resets proposal fields
Full Unstaking Period Modification
The full unstaking unlock period modification follows a secure two-step process with a mandatory waiting period.
prepareSetSecondsToUnlockFullUnstaking
Function Type: external
Function Signature: prepareSetSecondsToUnllockFullUnstaking(uint256)
Function Selector: 0x3d8ff69a
Initiates the process to change the full unstaking unlock period.
Parameters
Parameter | Type | Description |
---|---|---|
_secondsToUnllockFullUnstaking | uint256 | New full unstaking unlock period in seconds |
cancelSetSecondsToUnlockFullUnstaking
Function Type: external
Function Signature: cancelSetSecondsToUnllockFullUnstaking()
Function Selector: 0xb384c574
Allows the current admin to cancel a pending full unstaking unlock period change proposal.
confirmSetSecondsToUnlockFullUnstaking
Function Type: external
Function Signature: confirmSetSecondsToUnllockFullUnstaking()
Function Selector: 0x8f4b3f28
Allows the admin to confirm the new full unstaking unlock period after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The admin calls
prepareSetSecondsToUnllockFullUnstaking
with the new unlock period value - Sets
secondsToUnllockFullUnstaking.proposal = _secondsToUnllockFullUnstaking
andsecondsToUnllockFullUnstaking.timeToAccept = block.timestamp + 1 days
- The admin calls
-
Proposal Cancellation (Optional):
- The admin can call
cancelSetSecondsToUnllockFullUnstaking
to cancel the proposal at any time - Resets
secondsToUnllockFullUnstaking.proposal = 0
andsecondsToUnllockFullUnstaking.timeToAccept = 0
- The admin can call
-
Change Confirmation:
- The admin must wait 24 hours (1 day) after the proposal timestamp
- The admin calls
confirmSetSecondsToUnllockFullUnstaking
to implement the change - Function verifies
secondsToUnllockFullUnstaking.timeToAccept <= block.timestamp
- Updates
secondsToUnllockFullUnstaking.actual = secondsToUnllockFullUnstaking.proposal
and resets proposal fields
Flag Change Processes
Public Staking Flag Modification
The public staking flag modification follows a secure two-step process with a mandatory waiting period.
prepareChangeAllowPublicStaking
Function Type: external
Function Signature: prepareChangeAllowPublicStaking()
Function Selector: 0x27be0557
Initiates the process to toggle the allow public staking flag.
cancelChangeAllowPublicStaking
Function Type: external
Function Signature: cancelChangeAllowPublicStaking()
Function Selector: 0xb996b6c4
Allows the current admin to cancel a pending public staking flag change proposal.
confirmChangeAllowPublicStaking
Function Type: external
Function Signature: confirmChangeAllowPublicStaking()
Function Selector: 0x681f02ac
Allows the admin to confirm the new public staking flag state after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The admin calls
prepareChangeAllowPublicStaking
to initiate the flag toggle - Sets
allowPublicStaking.timeToAccept = block.timestamp + 1 days
- The admin calls
-
Proposal Cancellation (Optional):
- The admin can call
cancelChangeAllowPublicStaking
to cancel the proposal at any time - Resets
allowPublicStaking.timeToAccept = 0
- The admin can call
-
Change Confirmation:
- The admin must wait 24 hours (1 day) after the proposal timestamp
- The admin calls
confirmChangeAllowPublicStaking
to implement the change - Function verifies
allowPublicStaking.timeToAccept <= block.timestamp
- Creates new
BoolTypeProposal
withflag: !allowPublicStaking.flag
andtimeToAccept: 0
Presale Staking Flag Modification
The presale staking flag modification follows a secure two-step process with a mandatory waiting period.
prepareChangeAllowPresaleStaking
Function Type: external
Function Signature: prepareChangeAllowPresaleStaking()
Function Selector: 0xdfb2b3a4
Initiates the process to toggle the allow presale staking flag.
cancelChangeAllowPresaleStaking
Function Type: external
Function Signature: cancelChangeAllowPresaleStaking()
Function Selector: 0x7068dc65
Allows the current admin to cancel a pending presale staking flag change proposal.
confirmChangeAllowPresaleStaking
Function Type: external
Function Signature: confirmChangeAllowPresaleStaking()
Function Selector: 0x1e9c210f
Allows the admin to confirm the new presale staking flag state after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The admin calls
prepareChangeAllowPresaleStaking
to initiate the flag toggle - Sets
allowPresaleStaking.timeToAccept = block.timestamp + 1 days
- The admin calls
-
Proposal Cancellation (Optional):
- The admin can call
cancelChangeAllowPresaleStaking
to cancel the proposal at any time - Resets
allowPresaleStaking.timeToAccept = 0
- The admin can call
-
Change Confirmation:
- The admin must wait 24 hours (1 day) after the proposal timestamp
- The admin calls
confirmChangeAllowPresaleStaking
to implement the change - Function verifies
allowPresaleStaking.timeToAccept <= block.timestamp
- Creates new
BoolTypeProposal
withflag: !allowPresaleStaking.flag
andtimeToAccept: 0
Estimator Management
proposeEstimator
Function Type: external
Function Signature: proposeEstimator(address)
Initiates the process to change the estimator contract address.
Parameters
Parameter | Type | Description |
---|---|---|
_estimator | address | Address of the proposed new estimator |
rejectProposalEstimator
Function Type: external
Function Signature: rejectProposalEstimator()
Allows the current admin to cancel a pending estimator change proposal.
acceptNewEstimator
Function Type: external
Function Signature: acceptNewEstimator()
Allows the admin to confirm the new estimator address after the waiting period.
Complete Workflow
-
Proposal Initiation:
- The admin calls
proposeEstimator
with the new estimator address - Sets
estimator.proposal = _estimator
andestimator.timeToAccept = block.timestamp + 1 days
- The admin calls
-
Proposal Cancellation (Optional):
- The admin can call
rejectProposalEstimator
to cancel the proposal at any time - Resets
estimator.proposal = address(0)
andestimator.timeToAccept = 0
- The admin can call
-
Change Confirmation:
- The admin must wait 24 hours (1 day) after the proposal timestamp
- The admin calls
acceptNewEstimator
to implement the change - Function verifies
estimator.timeToAccept <= block.timestamp
- Updates
estimator.actual = estimator.proposal
and resets proposal fields